export function export_json_to_excel({
                                       multiHeader = [], // 第一行表头
                                       multiHeader2 = [],	// 第二行表头
                                       data,
                                       filename, //文件名
                                       merges = [], // 合并
                                       bookType = 'xlsx'
                                     } = {}) {
  /* original data */
  filename = filename || '列表';
  data = [...data]
  data.unshift(multiHeader2)
  data.unshift(multiHeader)
  console.log('data:', data)
  var ws_name = "SheetJS";
  var wb = new Workbook(),
    ws = sheet_from_array_of_arrays(data);

  if (merges.length > 0) {
    if (!ws['!merges']) ws['!merges'] = [];
    merges.forEach(item => {
      ws['!merges'].push(XLSX.utils.decode_range(item))
    })
  }

  /* add worksheet to workbook */
  wb.SheetNames.push(ws_name);
  wb.Sheets[ws_name] = ws;

  var wbout = XLSXStyle.write(wb, {
    bookType: bookType,
    bookSST: false,
    type: 'binary'
  });

  saveAs(new Blob([s2ab(wbout)], {
    type: "application/octet-stream"
  }), `${filename}.${bookType}`);
}
